package com.Map_Practice;

import java.util.Iterator;
import java.util.Scanner;

public class Input {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		
		operation();
	}

	static public void menu() {
		System.out.println("================");
		System.out.println("1、添加学员");
		System.out.println("2、删除学员");
		System.out.println("3、修改学员信息");
		System.out.println("4、查询学员信息");
		System.out.println("5、打印所有学生信息");
		System.out.println("6、加载系统学员信息");
		System.out.println("7、退出当前用户");
		System.out.println("8、退出程序写入（覆盖）学员信息");
		System.out.println("================");
	}

	static public void operation() {
		int id;
		String name;
		double score;
		while (true) {
			if (!Context.isLogin()) {
				Danlu.login();
			}
			menu();
			System.out.println("请选择操作");
			int key;
			try {
				key = Integer.valueOf(sc.nextLine());

			} catch (Exception e) {
				System.out.println("请选择正确的操作...");
				continue;
			}

			switch (key) {
			case 1:
				StudentController.addStudent();
				break;
			case 2:
				StudentController.deleteStudent();
				break;
			case 3:
				StudentController.editStudent();
				break;
			case 4:
				StudentController.findStudent();
				break;
			case 5:
				MapDemo.showAll();
				break;
			case 6:
				StudentController.Load();
				break;
			case 7:
				Danlu.logout();
				break;
			case 8:
				StudentController.exit();
				break;
			default:
				System.out.println("请选择正确的操作...");
				break;
			}

		}
	}
}
	